import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import Auth from '../components/Auth.vue';
import UserProfile from '../views/UserProfile.vue';
import MusicDetail from '../views/MusicDetail.vue';
import VinylManager from '../views/VinylManager.vue';
import UserManager from '../views/UserManager.vue';

const routes = [
  { 
    path: '/', 
    name: 'Home', 
    component: HomeView,
    meta: { 
      breadcrumb: '首页', 
      icon: 'home' // 添加图标标识符
    } 
  },
  { 
    path: '/auth', 
    name: 'Auth', 
    component: Auth,
    meta: { 
      parent: 'Home',
      breadcrumb: '登录', 
      icon: 'login' // 添加图标标识符
    } 
  },
  {
    path: '/user_profile',
    name: 'UserProfile',
    component: UserProfile, 
    meta: { 
      breadcrumb: '用户主页', 
      parent: 'Home',
      icon: 'user' // 添加图标标识符
    }, 
  },
  // 新增MusicDetail路由
  {
    path: '/music/:id',
    name: 'MusicDetail',
    component: MusicDetail,
    meta: { 
      breadcrumb: '音乐详情', 
      parent: 'Home',
      icon: 'music' // 添加图标标识符
    }, 
  },
  {
    path: '/user_manager',
    name: 'UserManager',
    component:UserManager,
    meta: { 
      breadcrumb: '用户信息管理', 
      parent: 'Home',
      icon: 'user', // 添加图标标识符
      requiresAdmin: true // 添加权限控制
    }, 
  },
  // 新增 VinylManager 路由
  {
    path: '/vinyl_manager',
    name: 'VinylManager',
    component: VinylManager,
    meta: { 
      breadcrumb: '黑胶唱片管理', 
      parent: 'Home',
      icon: 'vinyl' // 添加图标标识符
    }, 
  }
];
const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;